<#include "includemenu.html"/>
<!--<div class="rs_layout_right" style="width:300px;"></div>-->
<div class="rs_layout_center">
	<div class="rs_layout">
		<div class="rs_layout_center"> 
			<#if database??>
			<div class="rs_halfHeight">
				<div class="rs_layout">								
					<div class="rs_layout_center" style="padding-left:10px;overflow:auto;">
						<div class="clear">&nbsp;</div>
						<div class="tableScrollWrap">
							<table class="data_table_1">
								<tr>
									<th width="10%">资源名称：</th>
									<td width="15%"> 
										<#if database.connctiontype??&&database.connctiontype=='jdbc'>
											${database.name!''}
										<#elseif database.connctiontype??&&database.connctiontype=='jndi'>
											${database.jndiname!''}
										</#if>
									</td>
									<th width="10%">创建时间：</th>
									<td width="15%"><#if database.createtime??>${database.createtime?string("yyyy年MM月dd日 HH:mm:ss")}</#if></td>
								</tr>
								<tr>
									<th>数据库类型：</th>
									<td>${database.databasetype!''}</td>
									<th>资源类型：</th>
									<td>
									  <#if database.connctiontype??&&database.connctiontype=='jdbc'>JDBC数据库链接
									<#elseif database.connctiontype??&&database.connctiontype=='jndi'>JNDI数据库链接</#if>
									</td>
								</tr>
								<tr>
									<th>JDBC驱动：</th>
									<td colspan="3">${database.driverclazz!''}</td>
								</tr>
								<tr>
									<th>URL：</th>
									<td colspan="3">${database.databaseurl!''}</td>
								</tr>
								<tr>
									<th>访问账号：</th>
									<td>${database.account!''}</td>
									<th>密码访问：</th>
									<td>
									  <#if database.connctiontype??&&database.connctiontype=='jdbc'&& database.password?? && database.password != ''>
									  Yes <#else>No</#if>
									</td>
								</tr>
								<tr>
									<th>链接参数：</th>
									<td colspan="3">${database.connectparam!''}</td>
								</tr>
								<tr>
									<th></th>
									<td colspan="3">
									<div style="display: none;" id="temp_div"></div>
										<a onclick="loadURL('/${orgi}/dm/database/databasetest/${database.id!''}.html',$('#temp_div') , null)" href="javascript:void(0)" title="${database.name!''}"><i class="tabIcon tabicon-8"></i>测试</a>
										<a class="report" target="cube" href="/${orgi}/dm/database/databasecube/${database.id!''}.html"><i class="tabIcon tabicon-5"></i>数据模型</a>
										<a onclick="loadURL('/${orgi}/dm/database/databaseeditdo/${database.id!''}.html',$('#temp_div') , null)" href="javascript:void(0)" title="${database.name!''}"><i class="tabIcon tabicon-3"></i>重置连接池</a>
										<!-- <a href="javascript:void(0)"><i class="tabIcon tabicon-4"></i>清空日志</a> -->
									</td>
								</tr>
							</table>
						</div>
					</div>
				</div>
			</div>
			<div class="rs_halfHeight">
				<div class="rs_layout">
					<div class="rs_layout_center">
						<div class="rs_layout">
							<div class="rs_layout_top">
								<ul class="nav_tapWrap nav_tabwps_3">
									<li class="nav_tapIthems cur"><i class="tabIcon tabicon-2"></i>连接池信息</li>
									 <li class="nav_tapIthems "><i class="tabIcon tabicon-6"></i>调用统计</li>
									<!-- <li class="nav_tapIthems "><i class="tabIcon tabicon-4"></i>连接池日志</li> -->
								</ul>
							</div>
							<div class="rs_layout_center nav_tabwps_3con">
								<div class="nav_tabwps_3_layouts show">
									<div class="rs_layout">
										<div class="rs_layout_center" style="padding-left:10px;overflow:auto;">
											<div class="clear">&nbsp;</div>
											<div class="tableScrollWrap">
												<table class="data_table_1">
													<tr>
														<th width="10%">初始化连接大小：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.InitialSize!''}</#if></td>
														<th width="10%">最小空闲连接数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.MinIdle!''}</#if></td>
														<th width="10%">最大连接数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.MaxActive!''}</#if></td>
														<th width="10%">池中连接数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.PoolingCount!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">获取连接时检测：</th>
														<td width="10%"><#if datasourceMap??><#if datasourceMap.TestOnBorrow>true<#else>false</#if></#if></td>
														<th width="10%">空闲时检测：</th>
														<td width="10%"><#if datasourceMap??><#if datasourceMap.TestWhileIdle>true<#else>false</#if></#if></td>
														<th width="10%">连接放回连接池时检测：</th>
														<td width="15%"><#if datasourceMap??><#if datasourceMap.TestOnReturn>true<#else>false</#if></#if></td>
														<th width="10%"> 查询超时时间：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.QueryTimeout!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">事务查询超时时间：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.TransactionQueryTimeout!''}</#if></td>
														<th width="10%">登录超时时间：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.LoginTimeout!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">连接有效性检查类名：</th>
														<td colspan="7"><#if datasourceMap??>${datasourceMap.ValidConnectionCheckerClassName!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">ExceptionSorter类名：</th>
														<td colspan="7"><#if datasourceMap??>${datasourceMap.ExceptionSorterClassName!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">默认autocommit设置：</th>
														<td width="10%"><#if datasourceMap??><#if datasourceMap.DefaultAutoCommit>true<#else>false</#if></#if></td>
														<th width="10%"> 默认只读设置：</th>
														<td width="10%"><#if datasourceMap??><#if datasourceMap.DefaultReadOnly>true<#else>false</#if></#if></td>
														<!--<th width="10%"> 当前状态：</th>
														  <td width="10%"><label style="color:blue">正常</label></td>-->
														<th width="10%">默认事务隔离：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.DefaultTransactionIsolation!''}</#if></td>
													</tr>
													<tr>
														<th width="10%"> 等待次数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.NotEmptyWaitCount!''}</#if></td>
														<th width="10%">等待最大时长：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.NotEmptyWaitMillis!''}</#if></td>
															<th width="10%">filter类名:</th>
														<td colspan="7">
														<#if datasourceMap??>
															<#if datasourceMap.FilterClassNames??>
																<#list datasourceMap.FilterClassNames as name>
																	${name!''}</br>
																</#list>
															</#if>
														</#if></td>
													</tr>
												</table>
											</div>
										</div>
									</div>
								</div>
								<div class="nav_tabwps_3_layouts">
											<div class="rs_layout">
										<div class="rs_layout_center" style="padding-left:10px;overflow:auto;">
											<div class="clear">&nbsp;</div>
											<div class="tableScrollWrap">
												<table class="data_table_1">
													<tr>
														<th width="10%">活跃连接数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.ActiveCount!''}</#if></td>
														<th width="10%">活跃连接数峰值：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.ActivePeak!''}</#if></td>
														<th width="10%">活跃连接数峰值时间：</th>
														<td width="15%"><#if datasourceMap?? && datasourceMap.ActivePeakTime ??>${datasourceMap.ActivePeakTime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
														<th width="10%">逻辑连接打开次数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.LogicConnectCount!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">逻辑连接关闭次数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.LogicCloseCount!''}</#if></td>
														<th width="10%">逻辑连接错误次数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.LogicConnectErrorCount!''}</#if></td>
														<th width="10%">物理连接打开次数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.PhysicalConnectCount!''}</#if></td>
														<th width="10%">物理关闭数量：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.PhysicalCloseCount!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">物理连接错误次数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.PhysicalConnectErrorCount!''}</#if></td>
														<th width="10%">执行数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.ExecuteCount!''}</#if></td>
														<th width="10%">错误数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.ErrorCount!''}</#if></td>
														<th width="10%">提交数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.CommitCount!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">回滚数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.RollbackCount!''}</#if></td>
														<th width="10%">PSCache访问次数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.PSCacheAccessCount!''}</#if></td>
														<th width="10%">PSCache命中次数：</th>
														<td width="15%"><#if datasourceMap??>${datasourceMap.PSCacheHitCount!''}</#if></td>
														<th width="10%">PSCache丢失次数：</th>
														<td width="10%"><#if datasourceMap??>${datasourceMap.PSCacheMissCount!''}</#if></td>
													</tr>
													<tr>
														<th width="10%">事务时间分布：</th>
														<td width="10%"><#if datasourceMap??>
														<#if datasourceMap.TransactionHistogram??>
																<#list datasourceMap.TransactionHistogram as name>
																	${name!''}
																</#list>
															</#if>
														</#if>
														</td>
														<td width="10%" colspan="6" style="color: #cccccc">
															事务运行时间分布，分布区间为[0-10 ms, 10-100 ms, 100-1 s, 1-10 s, 10-100 s, >100 s]
														</td>
													</tr>
												</table>
											</div>
										</div>
									</div>
									
								</div>
								<div class="nav_tabwps_3_layouts">3</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			</#if>
		</div>
	</div>
</div>